<div ng-controller="modulesShopsCtrl">
    <div class="bg-light lter b-b wrapper-md">
        <h4 class="m-n font-thin">模块店铺管理</h4>
    </div>
    <div class="wrapper-md">

        <div class="col-sm-6" ng-controller="modulesCtrl">
            <div class="panel">
                <div class="panel-heading bg-light lter b-b wrapper-md">
                    <h4 class="m-n font-thin">已添加模块店铺</h4>
                </div>
                <div class="panel-body">
                    <div class="col-sm-8 text-left">
                        <form class="form-inline">
                            <div class="form-group">
                                <label class="control-label">店铺名称</label>
                                <input type="text" class="input-sm form-control" ng-model="modulesShopsVO.name"
                                       placeholder="店铺的名称">
                            </div>
                            <div class="form-group">
                                <label class="control-label">状态</label>
                                <select class="input-sm form-control" ng-model="modulesShopsVO.status"
                                        ng-options="item.value as item.name for item in statusObject">
                                    <option value="">全部</option>
                                </select>
                            </div>
                            <button class="btn btn-sm btn-info" ng-click="findModulesShopAll()">查询</button>
                        </form>
                    </div>
                </div>
                <div class="panel-body">
                    <div>
                        <table class="table-responsive table table-bordered table-striped b-t b-light m-n">
                            <thead>
                            <th>名称</th>
                            <th>是否返利</th>
                            <th>让利值(%)</th>
                            <th>状态</th>
                            <th>审核状态</th>
                            <th width="70">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="item in list">
                                <td>{{item.name}}</td>
                                <td>
                                    <span class="label bg-light"
                                          ng-class="{0:'bg-light',1:'bg-success'}[item.isOpenRebate]"
                                          ng-bind="{0:'否',1:'是'}[item.isOpenRebate]"></span>
                                </td>
                                <td>{{item.profit}}</td>
                                <td>
                                    <span class="badge bg-success" ng-if="item.status == 0">营业中</span>
                                    <span class="badge bg-danger" ng-if="item.status == 1">休息中</span>
                                    <span class="badge bg-danger" ng-if="item.status == 2">停业整顿</span>
                                </td>
                                <td>
                                    <span class="badge bg-danger" ng-if="item.auditStatus == 0">待审核</span>
                                    <span class="badge bg-danger" ng-if="item.auditStatus == 1">审核不通过</span>
                                    <span class="badge bg-success" ng-if="item.auditStatus == 2">审核通过</span>
                                </td>
                                <td class="t-btns">
                                    <button class="btn btn-sm btn-danger" ng-click="delModulesShop(item)">移除</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                            <span class="h6">~未搜索到任何数据~</span>
                        </div>
                        <div>
                            <circle-loading ng-if="app.loading"></circle-loading>
                        </div>
                    </div>
                </div>
                <footer class="panel-footer">
                    <div class="row">
                        <div class="col-sm-5 text-left text-center-xs">
                            <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共
                                {{totalItems}} 项
                            </small>
                        </div>
                        <div class="col-sm-7 text-right text-center-xs">
                            <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                        ng-change="pageChanged()" max-size="{{maxPageRow}}"
                                        class="pagination-sm m-t-none m-b"
                                        previous-text="上一页" next-text="下一页"
                                        first-text="首页" last-text="尾页"></pagination>
                        </div>
                    </div>
                </footer>
            </div>
        </div>

        <div class="col-sm-6" ng-controller="shopsCtrl">
            <div class="panel">
                <div class="panel-heading bg-light lter b-b wrapper-md">
                    <h4 class="m-n font-thin">未添加模块店铺</h4>
                </div>
                <div class="panel-body">
                    <div class="col-sm-8 text-left">
                        <form class="form-inline">
                            <div class="form-group">
                                <label class="control-label">店铺名称</label>
                                <input type="text" class="input-sm form-control" ng-model="shopsVO.name"
                                       placeholder="店铺的名称">
                            </div>
                            <div class="form-group">
                                <label class="control-label">状态</label>
                                <select class="input-sm form-control" ng-model="shopsVO.status"
                                        ng-options="item.value as item.name for item in statusObject">
                                    <option value="">全部</option>
                                </select>
                            </div>
                            <button class="btn btn-sm btn-info" ng-click="findShopAll()">查询</button>
                        </form>
                    </div>
                </div>
                <div class="panel-body">
                    <table class="table-responsive table table-bordered table-striped b-t b-light m-n">
                        <thead>
                        <th>名称</th>
                        <th>是否返利</th>
                        <th>让利值(%)</th>
                        <th>状态</th>
                        <th>审核状态</th>
                        <th width="70">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in list">
                            <td>{{item.name}}</td>
                            <td>
                                    <span class="label bg-light"
                                          ng-class="{0:'bg-light',1:'bg-success'}[item.isOpenRebate]"
                                          ng-bind="{0:'否',1:'是'}[item.isOpenRebate]"></span>
                            </td>
                            <td>{{item.profit}}</td>
                            <td>
                                <span class="badge bg-success" ng-if="item.status == 0">营业中</span>
                                <span class="badge bg-danger" ng-if="item.status == 1">休息中</span>
                                <span class="badge bg-danger" ng-if="item.status == 2">停业整顿</span>
                            </td>
                            <td>
                                <span class="badge bg-danger" ng-if="item.auditStatus == 0">待审核</span>
                                <span class="badge bg-danger" ng-if="item.auditStatus == 1">审核不通过</span>
                                <span class="badge bg-success" ng-if="item.auditStatus == 2">审核通过</span>
                            </td>
                            <td class="t-btns">
                                <button class="btn btn-sm btn-info" ng-click="addModulesShop(item)">添加</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div ng-if="shopList.length<=0 && !app.loading" class="padder-v text-center">
                        <span class="h6">~未搜索到任何数据~</span>
                    </div>
                    <div>
                        <circle-loading ng-if="app.loading"></circle-loading>
                    </div>
                </div>
                <footer class="panel-footer">
                    <div class="row">
                        <div class="col-sm-5 text-left text-center-xs">
                            <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共
                                {{totalItems}} 项
                            </small>
                        </div>
                        <div class="col-sm-7 text-right text-center-xs">
                            <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                        ng-change="pageChanged()" max-size="{{maxPageRow}}"
                                        class="pagination-sm m-t-none m-b"
                                        previous-text="上一页" next-text="下一页"
                                        first-text="首页" last-text="尾页"></pagination>
                        </div>
                    </div>
                </footer>
            </div>
        </div>
    </div>
</div>